﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

namespace CreatingTypes
{
    internal class _02LocalMethod
    {

        public void WriteCubes()
        {
            WriteLine(cube(200));

            int cube(int x) => x * x * x;
        }
        //本地方法中增加static修饰符,防止看到封闭方法中的局部变量和参数
        //public void WriteCubes2()
        //{
        //    int y = 200;
        //    static int cube(int x) => x * y;
        //}
    }
}
